package crp.core.workflow.domain.messages;

import com.qwlabs.exceptions.BadRequestException;
import com.qwlabs.exceptions.CodeException;
import com.qwlabs.exceptions.ConfigException;
import com.qwlabs.exceptions.NotFoundException;
import org.jboss.logging.annotations.Message;
import org.jboss.logging.annotations.MessageBundle;

import javax.inject.Inject;

import static org.jboss.logging.Messages.getBundle;

@MessageBundle(projectCode = "CRP-WORKFLOW")
public interface WorkflowMessages {
    @Inject
    WorkflowMessages INSTANCE = getBundle(WorkflowMessages.class);

    @Message(value = "找不到该模型, topic:{0}", format = Message.Format.MESSAGE_FORMAT)
    NotFoundException modelNotFound(String topic);

    @Message(value = "找不到该实例, id:{0}", format = Message.Format.MESSAGE_FORMAT)
    NotFoundException instanceNotFound(String id);

    @Message(value = "模型候选人表达式错误, model id:{0}, 节点:{1}", format = Message.Format.MESSAGE_FORMAT)
    ConfigException invalidModelCandidate(String modelId, String node);

    @Message(value = "下一节点不能为空", format = Message.Format.MESSAGE_FORMAT)
    BadRequestException nextNodeIsNull();

}
